/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author USER
 */
@Entity
@Table(name = "koltuk")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Koltuk.findAll", query = "SELECT k FROM Koltuk k"),
    @NamedQuery(name = "Koltuk.findByIdKoltuk", query = "SELECT k FROM Koltuk k WHERE k.idKoltuk = :idKoltuk")})
public class Koltuk implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idKoltuk")
    private Integer idKoltuk;
    @JoinColumn(name = "salonId", referencedColumnName = "idSalon")
    @ManyToOne
    private Salon salonId;
    @JoinColumn(name = "seyirciId", referencedColumnName = "idSeyirci")
    @ManyToOne
    private Seyirci seyirciId;

    public Koltuk() {
    }

    public Koltuk(Integer idKoltuk) {
        this.idKoltuk = idKoltuk;
    }

    public Integer getIdKoltuk() {
        return idKoltuk;
    }

    public void setIdKoltuk(Integer idKoltuk) {
        this.idKoltuk = idKoltuk;
    }

    public Salon getSalonId() {
        return salonId;
    }

    public void setSalonId(Salon salonId) {
        this.salonId = salonId;
    }

    public Seyirci getSeyirciId() {
        return seyirciId;
    }

    public void setSeyirciId(Seyirci seyirciId) {
        this.seyirciId = seyirciId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idKoltuk != null ? idKoltuk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Koltuk)) {
            return false;
        }
        Koltuk other = (Koltuk) object;
        if ((this.idKoltuk == null && other.idKoltuk != null) || (this.idKoltuk != null && !this.idKoltuk.equals(other.idKoltuk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Koltuk[ idKoltuk=" + idKoltuk + " ]";
    }
    
}
